package task.dao;

import java.io.File;
import java.net.MalformedURLException;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.io.SAXReader;

import task.ConnectionDescription;


public class DaoTest {

	/**
	 * @param args
	 * @throws DocumentException 
	 * @throws MalformedURLException 
	 */
	public static void main(String[] args) throws MalformedURLException, DocumentException {
		Document doc = parse(new File("data/taskData.xml"));
		TaskDao taskDao = new TaskDaoImpl(doc);
		ConnectionDao connectionDao = new ConnectionDaoImpl(doc);
		String[] tasks = taskDao.getTasks();
		ConnectionDescription[] conns = connectionDao.getConnectionDescriptions();
	}
	public static Document parse(File file) throws DocumentException {
        SAXReader reader = new SAXReader();
        Document document = reader.read(file);
        return document;
    }

}
